#include <stdio.h>

int f(int n){
	int r;
	if(n<0)
		printf("data error\n");
	else if(n==0)
		r=1;
	else
		r=n*f(n-1);
	return r;
}

int main(){
	int n;
	printf("please input a integer: ");
	scanf("%d",&n);
	int result=f(n);
	printf("Factorial=%d\n",result);
}
